import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'

import Layout from '@/components/Layout/Layout.vue'





Vue.use(VueRouter)

const routes = [
  {
    path:'/login',
    name:'login',
    component:Login
  },
  {
    path:'/register',
    name:'register',
    component:Register
  },
  {
    path:"/",
    component:Layout,
    children:[{
      path:'',
      component:()=>import("@/views/Home")
    },
    {
        path:'/film',
        component:()=>import("@/views/film/Header"),
        children:[
          {
            path:"detail",
            component:()=>import("@/views/film/Detail"),
          },
          {
            path:"ticket",
            component:()=>import("@/views/film/Ticket"),
          }
        ]
    },


    {
      path:'/films',
      component:()=>import("@/views/Films")},
    {
      path:'/activity',
      component:()=>import("@/views/Activity")},
    {
      path:'/message',
      component:()=>import("@/views/Message")},
      {
        path:'/seat',
        component:()=>import("@/views/Seat")},

    {
        path:'/me',
        component:()=>import("@/views/me/Header"),
        children:[
          {
            path:'cart',
            component:()=>import("@/views/me/Cart"),
          },
          {
            path:'order',
            component:()=>import("@/views/me/Order"),
          },
          {
            path:'setting',
            component:()=>import("@/views/me/Setting"),
          },
        ]
    }
  
    
  ] 
  }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
